package com.aita.diamond.service

import com.gd.magic.Service
import com.aita.diamond.DiamondType

class DiamondTypeService implements Service {
			
	public static final String FORMAT_YEARMONTH = "yyyyMM"
	
	def loadDiamondType(int id) {
		logger.debug("id  ...............") 
		long targetAreaId;
		String targetAreaName;
//		assert 1==0 : X("error")
		DiamondType diamondType = DiamondType.load(id)
	 
		def result = [diamondType:diamondType]
	
		return result;
		}
	
	def deleteDiamondType(long id){
		logger.debug("id  ...............")
		def now = new Date();
		DiamondType diamondType = DiamondType.load(id)
		assert diamondType : X("未找到"+ id)
		diamondType.remove()
	}
	
	def saveDiamondType(DiamondType diamondType) {
		assert diamondType: X("钻石类型为空")
		diamondType.persistOrMerge()
	}
	
	
}